using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Zhaoxi.Zhihu.Core.QuestionAggregate.Entites;

namespace Zhaoxi.Zhihu.Infrastructure.Configuration;

public class QuestionConfiguration:IEntityTypeConfiguration<Question>
{
    public void Configure(EntityTypeBuilder<Question> builder)
    {
        builder.Property(p => p.Title)
            .HasMaxLength(DataSchemaConstans.DefaultQuestionTitleLength)
            .IsRequired();

        builder.Property(p => p.Description)
            .HasColumnType("text");
    }
}